#include <stdio.h>
#include <unistd.h>
#include "ysh.h"
#include "error.h"

char error_message[ERROR_MESSAGE_LEN] = {0};
Bool with_error = FALSE;

void error_msg(char *err_msg)
{
    fprintf(stderr, "ERROR: %s", err_msg);
    with_error = TRUE;
}

// Unexpected token.
void error_unxtd_token(char *tb, char *context)
{
    sprintf(error_message, "Unexpected string \'%s\' found in %s.\n", tb, context);
    error_msg(error_message);
}

